package com.huatai.user.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.time.LocalDate;

/**
 * @program: nanming-saas
 * @description: 用户注册
 * @author: songxiude
 * @create: 2024-04-26 09:47
 **/
@Data
@ApiModel(value = "用户注册实体类", description = "用户注册实体类")
public class UserRegisterVo {
	@ApiModelProperty(value = "用户账号",required = true)
	@NotBlank(message = "用户账号不能为空")
	@Size(min = 8,max = 40,message = "账号长度必须为8到20个字符之间")
	private String account;

	@ApiModelProperty(value = "用户密码",required = true)
	@NotBlank(message = "密码不能为空")
	private String password;

//	@ApiModelProperty(value = "确认密码",required = true)
//	@NotBlank(message = "确认密码不能为空")
//	private String cpassword;

	@ApiModelProperty("用户昵称")
	@TableField("name")
	private String name;

	@ApiModelProperty("邮箱")
	@Email(message = "邮箱格式不正确")
	private String email;

	@ApiModelProperty(value = "电话号码",required = true)
	@NotBlank(message = "电话号码不能为空")
	@Pattern(regexp = "^1(3|4|5|7|8)\\d{9}$",message = "手机号码格式错误")
	private String phone;

	@ApiModelProperty("用户生日")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
	private LocalDate birthday;

	@ApiModelProperty("性别0未知1男2女")
	private Integer sex;
}
